<template>
        <div class="demo-input-suffix">
          <el-input class="no" type="text" v-model="reportNo" placeholder="请输入报告编号"></el-input>
        <el-button class="select" @click="findbyQuailyAdmin"  type="primary">查询</el-button>
         <el-button icon="el-icon-plus"  class="save" @click="addProductHandle"  type="info">添加</el-button>
      </div>

</template>

<script>

import api from "../../../api";
import {mapMutations} from "vuex"
export default {
  data(){
    return {
       tunnelList:[],
       reportNo:'',
       tId:''
    }
  },
  mounted() {
      // 查询隧道
      api.tunnelInfoFindByAll().then(res=>{
        if(res.data.code == 2001){
            this.tunnelList = res.data.data
        }
      }).catch(err=>{
        console.log(err)
      })
  },
  methods: {
    ...mapMutations("AddrPlaneModule",["setTunName"]),
    addProductHandle(){
        this.$bus.$emit("onAdderShow",true)
    },
    findByTid(){
      this.setTunName(this.tId)
    },
    findbyQuailyAdmin(){
      if (this.reportNo ===''){
        this.$message({
          message: '请输入报告编号',
          type: 'warning'
        });
        return
      }
      api.monitorMeasurefindByReportNo({testType:'二衬检测',reportNo:this.reportNo}).then(res=>{
        if (res.data.code == 2001){
          this.$bus.$emit("onAdderListShow",res.data.data)
        }
      }).catch(err=>{
        console.log(err)
      })
    }
  }

}
</script>

<style scoped>

.demo-input-suffix{
  margin-top: 20px;
  text-align: left;
}
.select{
  margin-left: 10px;
}

.save{
   margin-left: 10px;
   border: none;
   border: 2px solid #409EFF;
   background-color: white;
   color: #409EFF;
   height: 40px;
}
.input{
  width: 300px;
}
.no{
  width: 200px;
}
</style>